home *** CD-ROM | disk | FTP | other *** search
- PROGRAM read_data;
-
- { Read the data created in the program make_data }
-
- CONST
- {$I gemconst.pas}
-
- TYPE
- {$I gemtype.pas}
-
- rating = ( chief, cook, bottle_washer );
-
- info = record
- name : string [30];
- rank : rating;
- end; {info definition}
-
- VAR
- myfile : file of INFO;
- myrec : info;
-
- {$I gemsubs.pas}
-
- BEGIN
- IF Init_Gem >= 0 THEN
- BEGIN
- Reset( myfile, 'A:\INFO.DAT' );
- WHILE NOT( EOF( myfile )) DO
- BEGIN
- myrec := myfile^;
- WITH myrec DO
- BEGIN
- Writeln( name );
- CASE rank OF
- chief : Writeln( 'chief' );
- cook : Writeln( 'cook' );
- bottle_washer: Writeln( 'bottle washer' );
- END; {case}
- END; {with}
- Get( myfile );
- END; {while}
- Close( myfile );
- END; {if}
- Exit_Gem;
- END.
-